getBalanceList(0)


function getBalanceList(cate_id,keys) {

    layui.use('table', function() {
        var table = layui.table;

        table.render({
            url: '/index/card/log',
            where: {
                cate_id: cate_id,
                keys: keys
            },
            parseData: function(res) {
                return {
                    "code": res.code,
                    "msg": res.msg,
                    "count": res.data.total,
                    "data": res.data.data
                };
            },
            elem: '#tableData',
            cols: [[
                {field: 'type_id', title: '类型',templet:function(d){
                    if(d.type_id == 3){
                        return '<span>重置</span>'
                    }else if(d.type_id == 2){
                        return '<span>充值</span>'
                    }else{
                        return '<span>支出</span>'
                    }
                        
                    }
                },
                {field: 'keys', title: '卡密'},
                {field: 'price', title: '费用'},
                
                {field: 'mod', title: '模型'},
                {field: 'create_time', title: '日期'},
            ]],
            page: {
                limits: [10, 20, 30],
                limit: 10,
                count: 90
            },
            pagebar: '#table-page-bar'
        });
    });
}

function search() {
    getBalanceList($('#cate_id').val(),$('#search-order').val())
}


